Assessment of mental flexibility